package com.ham.ui;

import java.beans.PropertyVetoException;

import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JMenuItem;

import org.javabuilders.swing.SwingJavaBuilder;
import org.jdesktop.swingx.JXFrame;

/**
 * 
 * @author dprima
 * 
 */
public class SimpleFrame extends JXFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1426128711407513695L;

	private JDesktopPane desktopPane;
	private JMenuItem mnuItemLogout;
	private JMenuItem mnuItemLogin;
	private JMenuItem mnuItemMainPanel;

	public SimpleFrame() {
		SwingJavaBuilder.build(this);
	}

	public void setJXStatusBar(Object obj) {

	}

	public void mnuItemMainPanelAction() throws PropertyVetoException {
		JInternalFrame settingFrame = new JInternalFrame("Settings", true,
				true, true, true);
		settingFrame.add(new MainPanel());
		settingFrame.pack();
		desktopPane.add(settingFrame);
		settingFrame.setVisible(true);
		settingFrame.setMaximum(true);
	}

	public void exitApp() {
		this.dispose();
	}

	public void mnuItemLoginAction() throws PropertyVetoException {
		JInternalFrame settingFrame = new JInternalFrame("Settings", true,
				true, true, true);
		settingFrame.add(new SettingPanel());
		settingFrame.pack();
		desktopPane.add(settingFrame);
		settingFrame.setVisible(true);
		settingFrame.setMaximum(true);
	}

}
